#include "Storage.h"

void StorageStream::reset() {
    position = 0;
}

void Storage::load(int cnt, Persistent *persistent) {
    in.reset();

    for (int i = 0; i < cnt; ++i) {
        persistent[i].load(in);
    }
}

void Storage::save(int cnt, Persistent *persistent) {
    out.reset();

    for (int i = 0; i < cnt; ++i) {
        persistent[i].store(out);
    }
}
